//
//  SEGBottomPopCell.m
//  Uhomebk
//
//  Created by mac on 2017/8/9.
//  Copyright © 2017年 com.segi. All rights reserved.
//

#import "SEGBottomPopCell.h"

@implementation SEGBottomPopCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.backgroundColor = kColor_W;
    self.selectIcon.image = [[UIImage imageWithContentsOfFile:SEGPicName(@"icon_opendoor_select")] imageByTintColor:kColor_T];
    _titleLabel.font = kFont_16;
    _titleLabel.textColor = kColor_1;
}

/**
 填充数据

 @param data data
 @param popVCType type
 */
-(void)paddingDataWith:(id)data popVCType:(SEGBottomPopControllerType)popVCType
{
    
    switch (popVCType) {
            //1.工单类型菜单
        case SEGBottomPopControllerType_TYPE_MENU_LIST:
            [self paddTypeMenuData:data];
            break;
            //2.工单状态菜单
        case SEGBottomPopControllerType_STATUS_MENU_LIST:
            [self paddStatusMenuData:data];
            break;
            //3.小区菜单
        case SEGBottomPopControllerType_COMMUNITY_MENU_LIST:
            [self paddCommunityMenuData:data];
            break;
            //4.录入类型菜单
        case SEGBottomPopControllerType_ORDER_INPUT_SERVICE_LIST:
            [self paddInputTypeData:data];
            break;
            //5.预约时间段菜单
        case SEGBottomPopControllerType_BESPEL_TIME_LIST:
            [self paddbespelTimesData:data];
            break;
        default:
            break;
    }
}

-(void)paddTypeMenuData:(id)data
{
    NSDictionary *dict = data;
    _titleLabel.text = dict[@"templateName"];
    _selectIcon.hidden = [dict[@"isSelected"] isEqualToString:@"YES"]?NO:YES;
}

-(void)paddStatusMenuData:(id)data
{
    NSDictionary *dict = data;
    _titleLabel.text = dict[@"statusName"];
    _selectIcon.hidden = [dict[@"isSelected"] isEqualToString:@"YES"]?NO:YES;
}

-(void)paddCommunityMenuData:(id)data
{
    NSDictionary *dict = data;
    _titleLabel.text = dict[@"name"];
    _selectIcon.hidden = [dict[@"isSelected"] isEqualToString:@"YES"]?NO:YES;
}

-(void)paddInputTypeData:(id)data
{
    NSDictionary *dict = data;
    _titleLabel.text = dict[@"busiName"];
    _selectIcon.hidden = [dict[@"isSelected"] isEqualToString:@"YES"]?NO:YES;
}

-(void)paddbespelTimesData:(id)data
{
    NSDictionary *dict = data;
    _titleLabel.text = dict[@"bespealTimes"];
    _selectIcon.hidden = [dict[@"isSelected"] isEqualToString:@"YES"]?NO:YES;
}



@end
